//    Copyright (C) Kherty.  All rights reserved.
using OpenLS.Core.Serialization;

namespace OpenLS.Drawing.Media
{
    internal class AudioCDTime : IOfficeXmlSerializableAs
    {
        private byte track;
        private int time;

        public void ReadXmlAs(string name, ReadContext context)
        {
            using (var c = context.Read(name))
            {
                track = (byte)c.GetInteger("track");
                time = c.GetOptionalUIntegerAsInteger("time", 0);
            }
        }

        public void WriteXmlAs(string name, WriteContext context)
        {
            using (var c = context.Write(name))
            {
                c.SetInteger("track", track );
                c.SetOptionalUIntegerAsInteger("time",  time, 0 );
            }
        }
    }
}